package com.ptt.sqm.activity;

import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.widget.Toast;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ptt.sqm.session.SessionManager;
import com.ptt.sqm.util.DateDeserializer;
import com.ptt.sqm.ws.WebserviceCall;
import com.ptt.sqmonmobile.R;

public class DefaultFragmentActivity extends FragmentActivity {
	
	// Session Manager 
    SessionManager session;
    
    //Create Webservice class object
    WebserviceCall com; 
    Gson gson = new GsonBuilder()    
    .registerTypeAdapter(Date.class, new DateDeserializer()).create();  
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	// TODO Auto-generated method stub
    	super.onCreate(savedInstanceState);
    	// Session class instance
        session = new SessionManager(getApplicationContext());
        
        com = WebserviceCall.getInstance(getString(R.string.ws_url), getString(R.string.ws_namespace), session, this);

    }    
    
    @Override
    protected void onStop() {
    	// TODO Auto-generated method stub
    	super.onStop();
    	Log.i("Session" + this, "on Stop");  
    }
    
    @Override
    protected void onRestart() {
    	// TODO Auto-generated method stub
    	super.onRestart();
    	Log.i("Session" + this, "on Restart");    	
    }
    
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		Log.i("Session" + this, "on Resume");
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		Log.i("Session" + this, "on Pause");
	}
}
